package com.grape.dao.base;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import com.grape.domain.base.Standard;

public interface StandardRepository extends JpaRepository<Standard, Integer>{
	
	// 按照命名规则查询，试试sql能不能用
	public List<Standard> findByName(String name);
	
	
	// 居然可以，哟~~~~~~
	@Query(value="select * from t_standard ts where ts.c_name=?" ,nativeQuery=true)
	public List<Standard> sqlByName(String name);
	
	
	@Query(value="update Standard set maxLength=?2 where id=?1 ")
	@Modifying
	public void update(Integer i,Integer ml);
	
}
